package com.rla.service;

import com.alibaba.fastjson.JSONObject;
import com.rla.domain.MallOrder;
import com.rla.domain.vo.MallOrderVo;
import com.rla.domain.bo.MallOrderBo;
import com.rla.common.core.page.TableDataInfo;
import com.rla.common.core.domain.PageQuery;

import java.math.BigDecimal;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 零售订单Service接口
 *
 * @author rla
 * @date 2025-08-08
 */
public interface IMallOrderService {

    /**
     * 查询零售订单
     */
    MallOrderVo queryById(String id);

    /**
     * 查询零售订单列表
     */
    TableDataInfo<MallOrderVo> queryPageList(MallOrderBo bo, PageQuery pageQuery);

    /**
     * 查询零售订单列表
     */
    List<MallOrderVo> queryList(MallOrderBo bo);

    /**
     * 新增零售订单
     */
    Boolean insertByBo(MallOrderBo bo);


    /**
     * 修改零售订单
     */
    Boolean updateByBo(MallOrderBo bo);

    Boolean refundApply(MallOrderBo bo);
    Boolean cancelRefund(MallOrderBo bo);

    Boolean confirmReceipt(MallOrderBo bo);

    /**
     * 校验并批量删除零售订单信息
     */
    Boolean deleteWithValidByIds(Collection<String> ids, Boolean isValid);

    MallOrderVo getPayInfoById(String id);

    JSONObject getLogisticsInfo(MallOrderBo bo);

    Map<String,Object> queryOrderNum();

    boolean autoComplete(String orderId, boolean isThrow);

    boolean deliverByPd(MallOrderBo bo);

    /**
     * 订单赠送积分
     * @param userId
     * @param amount
     * @return
     */
    boolean rewardPoints(String userId, Double amount,String orderId);

    boolean deductPoints(String orderId);
}
